﻿using System;
using System.Threading;
using System.Windows.Forms;
using Barbar.Colonization.Core.Configuration;
using Barbar.Colonization.Model;
using Barbar.Colonization.Model.RuleSets;
using Barbar.Colonization.Model.Script.GameCommands;

namespace Barbar.Colonization.WorldEditor {
  static class Program {
    public static Game Game = new Game();

    [STAThread]
    static void Main() {
      Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(1033);

      IRuleSet ruleSet = XmlRuleSet.LoadRuleSet(ColonizationConfig.Instance.RuleSetPath);

      SetRuleSet setRuleSetCommand = new SetRuleSet(Game, ruleSet);
      setRuleSetCommand.Execute();

      CreateWorld createWorldCommand = new CreateWorld(Game, 80, 60);
      createWorldCommand.Execute();

      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);

      Application.Run(new FormMain());
    }
  }
}
